<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLikesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('likes', function (Blueprint $table) {
            $table->increments('like_id')->comment('主键');
            $table->string('item_type', 10)->comment('对象类型: comment  content  user');
            $table->integer('item_id')->comment('对象ID');
            $table->integer('like_type')->comment('点赞类型:0->取消 1->顶 2->踩');
            $table->integer('user_id')->comment('用户ID');
            $table->string('user_name', 20)->comment('用户昵称');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('likes');
    }
}
